﻿using System;
using K9Nano.Domain;
using K9Nano.Share.Annotations;
using Microsoft.AspNetCore.Identity;

namespace K9Nano.Authentication
{
    [SharedTable]
    public class User: IdentityUser<Guid>, IFullAudited, IEntity<Guid>, IMayHaveTenant
    {
        public Guid? CreatorUserId { get; set; }
        public DateTimeOffset CreationTime { get; set; }
        public Guid? LastModifierUserId { get; set; }
        public DateTimeOffset? LastModificationTime { get; set; }
        public bool IsDeleted { get; set; }
        public Guid? DeleterUserId { get; set; }
        public DateTimeOffset? DeletionTime { get; set; }
        public Guid? TenantId { get; set; }

        public virtual bool IsTransient() => Id == Guid.Empty;
    }
}